import cv2
import numpy as np


girl = cv2.imread("../asset/girl.jpeg")

logo = cv2.imread("../asset/dog.jpg")
new_logo = cv2.resize(logo, (200, 200))
gray = cv2.cvtColor(new_logo, cv2.COLOR_BGR2GRAY)
ret, mask = cv2.threshold(gray, 180, 255, cv2.THRESH_BINARY)
#b g r
new_mask = cv2.merge([mask, mask, mask])
# mask
new_logo2 = cv2.subtract(new_logo, new_mask)

roi = girl[0:200, 0:200]
tmp = cv2.bitwise_and(roi, roi, mask=mask)
dst = cv2.add(tmp, new_logo2)
girl[0:200, 0:200] = dst
while True:
    cv2.imshow('dst', dst)
    cv2.imshow('girl', girl)
    key = cv2.waitKey(10)
    if key & 0xFF == ord('q'):
        break

cv2.destroyAllWindows()
